<?php
/**
 * SBProductCollectionCreative
 *
 * PHP version 5
 *
 * @category Class
 * @package  AmazonAdvertisingApi
 * @author   vv_guo
 * @link    https://gitee.com/HuaLiLiDeDiDiao/amazon-advertising-api
 */

/**
 * Amazon Ads API - Sponsored Brands
 *
 * Use the Amazon Ads API for Sponsored Brands for campaign, ad group, keyword, negative keyword, drafts, Stores, landing pages, and Brands management operations. For more information about Sponsored Brands, see the [Sponsored Brands Support Center](https://advertising.amazon.com/help#GQFZA83P55P747BZ). For onboarding information, see the [account setup](https://advertising.amazon.com/API/docs/v3/guides/account_setup) topic.
 *
 * OpenAPI spec version: 3.0
 * 
 * Generated by:https://gitee.com/HuaLiLiDeDiDiao/amazon-advertising-api.git
 * AmazonAdvertisingApi Codegen version: 3.0.51
 */
/**
 * NOTE: This class is auto generated by the AmazonAdvertisingApi code generator program.
 *https://gitee.com/HuaLiLiDeDiDiao/amazon-advertising-api
 * Do not edit the class manually.
 */

namespace AmazonAdvertisingApi\Model;

use \ArrayAccess;
use \AmazonAdvertisingApi\ObjectSerializer;

/**
 * SBProductCollectionCreative Class Doc Comment
 *
 * @category Class
 * @package  AmazonAdvertisingApi
 * @author   vv_guo
 * @link    https://gitee.com/HuaLiLiDeDiDiao/amazon-advertising-api
 */
class SBProductCollectionCreative implements ModelInterface, ArrayAccess
{
    const DISCRIMINATOR = null;

    /**
      * The original name of the model.
      *
      * @var string
      */
    protected static $AmazonAdvertisingApiModelName = 'SBProductCollectionCreative';

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $AmazonAdvertisingApiTypes = [
        'brand_logo_crop' => '\AmazonAdvertisingApi\Model\SBBrandLogoCrop',
        'asins' => 'string[]',
        'brand_logo_url' => 'string',
        'brand_name' => 'string',
        'custom_image_asset_id' => 'string',
        'should_optimize_asins' => 'bool',
        'custom_image_crop' => '\AmazonAdvertisingApi\Model\SBCustomImageCrop',
        'custom_image_url' => 'string',
        'brand_logo_asset_id' => 'string',
        'headline' => 'string'
    ];

    /**
      * Array of property to format mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $AmazonAdvertisingApiFormats = [
        'brand_logo_crop' => null,
        'asins' => null,
        'brand_logo_url' => null,
        'brand_name' => null,
        'custom_image_asset_id' => null,
        'should_optimize_asins' => null,
        'custom_image_crop' => null,
        'custom_image_url' => null,
        'brand_logo_asset_id' => null,
        'headline' => null
    ];

    /**
     * Array of property to type mappings. Used for (de)serialization
     *
     * @return array
     */
    public static function AmazonAdvertisingApiTypes()
    {
        return self::$AmazonAdvertisingApiTypes;
    }

    /**
     * Array of property to format mappings. Used for (de)serialization
     *
     * @return array
     */
    public static function AmazonAdvertisingApiFormats()
    {
        return self::$AmazonAdvertisingApiFormats;
    }

    /**
     * Array of attributes where the key is the local name,
     * and the value is the original name
     *
     * @var string[]
     */
    protected static $attributeMap = [
        'brand_logo_crop' => 'brandLogoCrop',
        'asins' => 'asins',
        'brand_logo_url' => 'brandLogoUrl',
        'brand_name' => 'brandName',
        'custom_image_asset_id' => 'customImageAssetId',
        'should_optimize_asins' => 'shouldOptimizeAsins',
        'custom_image_crop' => 'customImageCrop',
        'custom_image_url' => 'customImageUrl',
        'brand_logo_asset_id' => 'brandLogoAssetID',
        'headline' => 'headline'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'brand_logo_crop' => 'setBrandLogoCrop',
        'asins' => 'setAsins',
        'brand_logo_url' => 'setBrandLogoUrl',
        'brand_name' => 'setBrandName',
        'custom_image_asset_id' => 'setCustomImageAssetId',
        'should_optimize_asins' => 'setShouldOptimizeAsins',
        'custom_image_crop' => 'setCustomImageCrop',
        'custom_image_url' => 'setCustomImageUrl',
        'brand_logo_asset_id' => 'setBrandLogoAssetId',
        'headline' => 'setHeadline'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'brand_logo_crop' => 'getBrandLogoCrop',
        'asins' => 'getAsins',
        'brand_logo_url' => 'getBrandLogoUrl',
        'brand_name' => 'getBrandName',
        'custom_image_asset_id' => 'getCustomImageAssetId',
        'should_optimize_asins' => 'getShouldOptimizeAsins',
        'custom_image_crop' => 'getCustomImageCrop',
        'custom_image_url' => 'getCustomImageUrl',
        'brand_logo_asset_id' => 'getBrandLogoAssetId',
        'headline' => 'getHeadline'
    ];

    /**
     * Array of attributes where the key is the local name,
     * and the value is the original name
     *
     * @return array
     */
    public static function attributeMap()
    {
        return self::$attributeMap;
    }

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @return array
     */
    public static function setters()
    {
        return self::$setters;
    }

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @return array
     */
    public static function getters()
    {
        return self::$getters;
    }

    /**
     * The original name of the model.
     *
     * @return string
     */
    public function getModelName()
    {
        return self::$AmazonAdvertisingApiModelName;
    }



    /**
     * Associative array for storing property values
     *
     * @var mixed[]
     */
    protected $container = [];

    /**
     * Constructor
     *
     * @param mixed[] $data Associated array of property values
     *                      initializing the model
     */
    public function __construct(array $data = null)
    {
        $this->container['brand_logo_crop'] = isset($data['brand_logo_crop']) ? $data['brand_logo_crop'] : null;
        $this->container['asins'] = isset($data['asins']) ? $data['asins'] : null;
        $this->container['brand_logo_url'] = isset($data['brand_logo_url']) ? $data['brand_logo_url'] : null;
        $this->container['brand_name'] = isset($data['brand_name']) ? $data['brand_name'] : null;
        $this->container['custom_image_asset_id'] = isset($data['custom_image_asset_id']) ? $data['custom_image_asset_id'] : null;
        $this->container['should_optimize_asins'] = isset($data['should_optimize_asins']) ? $data['should_optimize_asins'] : null;
        $this->container['custom_image_crop'] = isset($data['custom_image_crop']) ? $data['custom_image_crop'] : null;
        $this->container['custom_image_url'] = isset($data['custom_image_url']) ? $data['custom_image_url'] : null;
        $this->container['brand_logo_asset_id'] = isset($data['brand_logo_asset_id']) ? $data['brand_logo_asset_id'] : null;
        $this->container['headline'] = isset($data['headline']) ? $data['headline'] : null;
    }

    /**
     * Show all the invalid properties with reasons.
     *
     * @return array invalid properties with reasons
     */
    public function listInvalidProperties()
    {
        $invalidProperties = [];

        return $invalidProperties;
    }

    /**
     * Validate all the properties in the model
     * return true if all passed
     *
     * @return bool True if all properties are valid
     */
    public function valid()
    {
        return count($this->listInvalidProperties()) === 0;
    }


    /**
     * Gets brand_logo_crop
     *
     * @return \AmazonAdvertisingApi\Model\SBBrandLogoCrop
     */
    public function getBrandLogoCrop()
    {
        return $this->container['brand_logo_crop'];
    }

    /**
     * Sets brand_logo_crop
     *
     * @param \AmazonAdvertisingApi\Model\SBBrandLogoCrop $brand_logo_crop brand_logo_crop
     *
     * @return $this
     */
    public function setBrandLogoCrop($brand_logo_crop)
    {
        $this->container['brand_logo_crop'] = $brand_logo_crop;

        return $this;
    }

    /**
     * Gets asins
     *
     * @return string[]
     */
    public function getAsins()
    {
        return $this->container['asins'];
    }

    /**
     * Sets asins
     *
     * @param string[] $asins asins
     *
     * @return $this
     */
    public function setAsins($asins)
    {
        $this->container['asins'] = $asins;

        return $this;
    }

    /**
     * Gets brand_logo_url
     *
     * @return string
     */
    public function getBrandLogoUrl()
    {
        return $this->container['brand_logo_url'];
    }

    /**
     * Sets brand_logo_url
     *
     * @param string $brand_logo_url The address of the hosted image.
     *
     * @return $this
     */
    public function setBrandLogoUrl($brand_logo_url)
    {
        $this->container['brand_logo_url'] = $brand_logo_url;

        return $this;
    }

    /**
     * Gets brand_name
     *
     * @return string
     */
    public function getBrandName()
    {
        return $this->container['brand_name'];
    }

    /**
     * Sets brand_name
     *
     * @param string $brand_name A brand name. Maximum length is 30 characters.
     *
     * @return $this
     */
    public function setBrandName($brand_name)
    {
        $this->container['brand_name'] = $brand_name;

        return $this;
    }

    /**
     * Gets custom_image_asset_id
     *
     * @return string
     */
    public function getCustomImageAssetId()
    {
        return $this->container['custom_image_asset_id'];
    }

    /**
     * Sets custom_image_asset_id
     *
     * @param string $custom_image_asset_id The identifier of the Custom image from the Store assets library. See [the policy](https://advertising.amazon.com/resources/ad-policy/sponsored-ads-policies#customimage) for more information on what constitutes a valid Custom image.
     *
     * @return $this
     */
    public function setCustomImageAssetId($custom_image_asset_id)
    {
        $this->container['custom_image_asset_id'] = $custom_image_asset_id;

        return $this;
    }

    /**
     * Gets should_optimize_asins
     *
     * @return bool
     */
    public function getShouldOptimizeAsins()
    {
        return $this->container['should_optimize_asins'];
    }

    /**
     * Sets should_optimize_asins
     *
     * @param bool $should_optimize_asins Starting on March 25th, 2021, this property will no longer be supported. This feature is currently available in the US and UK. Existing Sponsored Brands campaigns with product optimization enabled will no longer have the products in the creative automatically optimized. Campaigns with product optimization enabled will be converted to standard Sponsored Brands product collection campaigns with the default selected products showing in the creative. For POST and PUT operations, setting this property to true will not have any effect. The value returned in the response will always be false. For the GET operation, the value of this field will always be false. And starting on September 25th, 2021, this property will be removed completely.
     *
     * @return $this
     */
    public function setShouldOptimizeAsins($should_optimize_asins)
    {
        $this->container['should_optimize_asins'] = $should_optimize_asins;

        return $this;
    }

    /**
     * Gets custom_image_crop
     *
     * @return \AmazonAdvertisingApi\Model\SBCustomImageCrop
     */
    public function getCustomImageCrop()
    {
        return $this->container['custom_image_crop'];
    }

    /**
     * Sets custom_image_crop
     *
     * @param \AmazonAdvertisingApi\Model\SBCustomImageCrop $custom_image_crop custom_image_crop
     *
     * @return $this
     */
    public function setCustomImageCrop($custom_image_crop)
    {
        $this->container['custom_image_crop'] = $custom_image_crop;

        return $this;
    }

    /**
     * Gets custom_image_url
     *
     * @return string
     */
    public function getCustomImageUrl()
    {
        return $this->container['custom_image_url'];
    }

    /**
     * Sets custom_image_url
     *
     * @param string $custom_image_url The address of the hosted Custom image.
     *
     * @return $this
     */
    public function setCustomImageUrl($custom_image_url)
    {
        $this->container['custom_image_url'] = $custom_image_url;

        return $this;
    }

    /**
     * Gets brand_logo_asset_id
     *
     * @return string
     */
    public function getBrandLogoAssetId()
    {
        return $this->container['brand_logo_asset_id'];
    }

    /**
     * Sets brand_logo_asset_id
     *
     * @param string $brand_logo_asset_id The identifier of the brand logo image from the Store assets library. See [listAssets](https://advertising.amazon.com/API/docs/v3/reference/SponsoredBrands/Stores) for more information. Note that for campaigns created in the Amazon Advertising console prior to release of the Store assets library, responses will not include a value for the brandLogoAssetID field.
     *
     * @return $this
     */
    public function setBrandLogoAssetId($brand_logo_asset_id)
    {
        $this->container['brand_logo_asset_id'] = $brand_logo_asset_id;

        return $this;
    }

    /**
     * Gets headline
     *
     * @return string
     */
    public function getHeadline()
    {
        return $this->container['headline'];
    }

    /**
     * Sets headline
     *
     * @param string $headline The headline text. Maximum length of the string is 50 characters for all marketplaces other than Japan, which has a maximum length of 35 characters.
     *
     * @return $this
     */
    public function setHeadline($headline)
    {
        $this->container['headline'] = $headline;

        return $this;
    }
    /**
     * Returns true if offset exists. False otherwise.
     *
     * @param integer $offset Offset
     *
     * @return boolean
     */
    #[\ReturnTypeWillChange]
    public function offsetExists($offset)
    {
        return isset($this->container[$offset]);
    }

    /**
     * Gets offset.
     *
     * @param integer $offset Offset
     *
     * @return mixed
     */
    #[\ReturnTypeWillChange]
    public function offsetGet($offset)
    {
        return isset($this->container[$offset]) ? $this->container[$offset] : null;
    }

    /**
     * Sets value based on offset.
     *
     * @param integer $offset Offset
     * @param mixed   $value  Value to be set
     *
     * @return void
     */
    #[\ReturnTypeWillChange]
    public function offsetSet($offset, $value)
    {
        if (is_null($offset)) {
            $this->container[] = $value;
        } else {
            $this->container[$offset] = $value;
        }
    }

    /**
     * Unsets offset.
     *
     * @param integer $offset Offset
     *
     * @return void
     */
    #[\ReturnTypeWillChange]
    public function offsetUnset($offset)
    {
        unset($this->container[$offset]);
    }

    /**
     * Gets the string presentation of the object
     *
     * @return string
     */
    public function __toString()
    {
        if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
            return json_encode(
                ObjectSerializer::sanitizeForSerialization($this),
                JSON_PRETTY_PRINT
            );
        }

        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
    }
}
